﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title id='Description'>In this demo is demonstrated how to change the DropDown's Animation.
    </title>
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="../../scripts/demos.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcombobox.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxradiobutton.js"></script>
</head>
<body>
    <div id='content'>
        <script type="text/javascript">
            $(document).ready(function () {               
                var url = "../sampledata/customers.txt";

                // prepare the data
                var source =
                {
                    datatype: "json",
                    datafields: [
                        { name: 'CompanyName' },
                        { name: 'ContactName' }
                    ],
                    id: 'id',
                    url: url,
                    async: false
                };
                var dataAdapter = new $.jqx.dataAdapter(source);

                // Create a jqxComboBox
                $("#combobox").jqxComboBox({ selectedIndex: 0, source: dataAdapter, animationType: 'fade', dropDownHorizontalAlignment: 'right', displayMember: "ContactName", valueMember: "CompanyName", dropDownWidth: 200, width: 150, height: 25});
                $("#noneAnimation").jqxRadioButton({  checked: false });
                $("#slideAnimation").jqxRadioButton({  checked: false });
                $("#fadeAnimation").jqxRadioButton({  checked: true });
                $("#noneAnimation").on('checked', function () {
                    $("#combobox").jqxComboBox({ animationType: 'none' });
                });

                $("#fadeAnimation").on('checked', function () {
                    $("#combobox").jqxComboBox({ animationType: 'fade' });
                });

                $("#slideAnimation").on('checked', function () {
                    $("#combobox").jqxComboBox({ animationType: 'slide' });
                });
            });
        </script>
        <div>
            <div style="float: left; font-size: 13px; font-family: Verdana;" id="selectionlog">
                <h3>
                    Animation Type</h3>
                <div id='noneAnimation'>
                    None</div>
                <div style='margin-top: 10px;' id='slideAnimation'>
                    Slide</div>
                <div style='margin-top: 10px;' id='fadeAnimation'>
                    Fade</div>
            </div>
            <div style='float: left; margin-top: 20px; margin-left: 100px;' id='combobox'>
            </div>
        </div>
    </div>
</body>
</html>
